-
Notifications
You must be signed in to change notification settings - Fork 14.1k
Replace black with ruff in tidy
#133821
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace black with ruff in tidy
#133821
Conversation
|
r? @onur-ozkan rustbot has assigned @onur-ozkan. Use |
|
I think trimming the python deps (and also making py fmt slightly faster) is nice, will let Onur assess if the improvement is worth the churn of reformatting |
onur-ozkan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we decide to merge this, we'll need to "reformat the world"
I liked the changes in this PR, how much change do you mean with "world"? Can you make a draft PR to show that?
|
Some changes occurred in src/tools/clippy cc @rust-lang/clippy The Miri subtree was changed cc @rust-lang/miri Some changes occurred in compiler/rustc_codegen_gcc |
|
I committed the change. It also modifies subtress though, e.g. |
That or formatting them there first (would be pretty exhausting to file PR one by one). -- I think the overall change is not too much and the changes are all in python files, so they likely won't cause so many conflicts with other ongoing tasks/PRs. We can land this easily once subtrees are handled. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Chances are if we ever edit this file in Miri it'll be formatted wrong... I know nothing about Python formatting.^^
But usually we exclude subprojects from formatting (e.g. via rustfmt).
e571e0c to
536516f
Compare
|
Ok, I ignored |
|
@bors r+ |
ruffcan both lint and format Python code (in fact, it should be a mostly drop-in replacement forblackin terms of formatting), so it's not needed to useblackanymore. This PR removesblackand replaces it withruff, to get rid of one Python dependency, and also to make Python formatting faster (although that's a small thing).If we decide to merge this, we'll need to "reformat the world" -
ruffis not perfectly compatible withblack, and it also looks likeblackwas actually ignoring some files before. I tried it locally (./x test tidy --extra-checks=py:fmt --bless) and it also reformatted some code in subtrees (e.g.clippyorrustc_codegen_gcc) - I'm not sure how to handle that.